import request from './index'

export const i18nListApi= async (data:{current?:string,currentSize?:string})=>{
    const url = new URLSearchParams(data).toString()
    const result = await request.get(`/i18n/list?${url}`)
    return result
}

export const i18nDeleteApi= async (code:string)=>{
    const result = await request.delete(`/i18n/delete/${code}`)
    return result
}

// "code":"HOME_TITLE",
//         "remarks":"首页标题(更新)",
//         "languageTexts":[
//           {"languageTag":"zh-CN","message":"首页(更新)"},
//           {"languageTag":"en-US","message":"Home (Updated)"}]

export const i18nUpdateApi= async (data:any)=>{
    const result = await request.post(`/i18n/update`,data)
    return result
}

export const i18nCreateApi= async (data:any)=>{
    const result = await request.post(`/i18n/create`,data)
    return result
}


export const i18nLanguageTagApi= async (data:any)=>{
    const result = await request.post(`/i18n/${data.languageTag}`)
    return result
}